﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;

namespace App26
{
    public sealed partial class LockScreen : UserControl, IScrollSnapPointsInfo
    {
        public LockScreen()
        {
            this.InitializeComponent();
        }

        public double TextOpacity
        {
            get { return this.LockText.Opacity; }
            set { SetValue(TextOpacityProperty, value); }
        }
        public static readonly DependencyProperty TextOpacityProperty =
            DependencyProperty.Register("TextOpacity", typeof(double),
            typeof(LockScreen), new PropertyMetadata(1, TextOpacityChanged));
        private static void TextOpacityChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            var c = d as LockScreen;
            c.LockText.Opacity = (double)e.NewValue;
        }

        public IReadOnlyList<float> GetIrregularSnapPoints(Orientation orientation, SnapPointsAlignment alignment)
        {
            var list = new List<float>(new[] { 7f * 75f, 7f * 75f });
            return new ReadOnlyCollection<float>(list);
        }

        public float GetRegularSnapPoints(Orientation orientation, SnapPointsAlignment alignment, out float offset) { throw new NotImplementedException(); }
        public bool AreHorizontalSnapPointsRegular { get { throw new NotImplementedException(); } }
        public bool AreVerticalSnapPointsRegular { get { return false; } }
        public event EventHandler<object> HorizontalSnapPointsChanged;
        public event EventHandler<object> VerticalSnapPointsChanged;
    }
}
